package com.macro.mall.dao;

import com.macro.mall.dto.PmsProductResult;
import com.macro.mall.model.SmsFlashPromotion;
import com.macro.mall.model.SmsFlashPromotionProductRelation;
import com.macro.mall.model.SmsFlashPromotionSkuRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PmsPanicBuyingMapper {

    List<PmsProductResult> getUpdateInfo(Long id);
    //校验当前活动是否开启
    SmsFlashPromotionSkuRelation checkWhether(Long id);
    //从relation获取sku 级 得到活动id 和场次id 作为组合条件  删除sms_flash_promotion_sku_relation表记录
    void delbyid(@Param("skuId") Long skuId,
                 @Param("flashPromotionId") Integer flashPromotionId,
                 @Param("flashPromotionSessionId") Integer flashPromotionSessionId);

    //判断状态是否开启
    SmsFlashPromotion stateid(Long pid);


    void add(@Param("skuId") Long skuId, @Param("relation") SmsFlashPromotionProductRelation relation);

}
